/**
 * @author songxinfeng
 * @date 2024-03-21
 */

import request from '@/utils/request'

export interface User {
  id: number
  name: string
  username: string
  email: string
  phone: string
  departmentId: number
  departmentName: string
  position: string
  status: string
  createAt: string
  updateAt: string
}

export function getDepartmentUsers(departmentId: number) {
  return request.get<User[]>(`/api/departments/${departmentId}/users`)
}

export const getDepartmentAndChildrenUsers = (departmentId: number) => {
  return request.get(`/api/departments/${departmentId}/all-users`)
}
